package com.code.thread;

/**
 * @description: 继承Thread类开启线程
 * @author: lwh
 * @date: Created in 2020/3/17 11:33
 * @modified By:
 */

public class ThreadDemo01 {
    public static void main(String[] args) {
        VideoThread videoThread1 = new VideoThread();
        VideoThread videoThread2 = new VideoThread();
        videoThread1.start();
        videoThread2.start();

        for (int i = 0; i < 2; i++) {
            System.out.println(Thread.currentThread().getName()+"->主线程在运行");
        }
    }
}

class VideoThread extends Thread{

    @Override
    public void run() {
        for (int i = 0; i < 3; i++) {
            System.out.println(Thread.currentThread().getName()+"->开始播放视频");
        }
    }
}